package com.nbst.model.mes;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * 
 * @ClassName: AutoRep
 * @Description:自动报工数据集
 * @author wl
 * @date 2018年10月22日
 *
 */
public class AutoRep {
	private String id;
	private Integer fIcmoId;
	private String fBillNo;
	private String fNumber;
	private String fName;
	private String fModel;
	private Integer fOperSN;
	private String fOperID;
	private String fNote;
	private Double fTargetQty;
	private String fStartTime;
	private String fEndTime;
	private String fDepName;
	private String fDepid;
	private String fIsOutStock;
	private String fMacId;
	private String fworker;
	private Double fQtypass;
	private Double fqtyfinish;
	private Double fqtyForItem;
	private Double fqtylost;
	private Double fQtyscrap;
	private Double fQtyback;

	public String getFworker() {
		return fworker;
	}

	public void setFworker(String fworker) {
		this.fworker = fworker;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getfIcmoId() {
		return fIcmoId;
	}

	public void setfIcmoId(Integer fIcmoId) {
		this.fIcmoId = fIcmoId;
	}

	public String getfBillNo() {
		return fBillNo;
	}

	public void setfBillNo(String fBillNo) {
		this.fBillNo = fBillNo;
	}

	public String getfNumber() {
		return fNumber;
	}

	public void setfNumber(String fNumber) {
		this.fNumber = fNumber;
	}

	public String getfName() {
		return fName;
	}

	public void setfName(String fName) {
		this.fName = fName;
	}

	public String getfModel() {
		return fModel;
	}

	public void setfModel(String fModel) {
		this.fModel = fModel;
	}

	public Integer getfOperSN() {
		return fOperSN;
	}

	public void setfOperSN(Integer fOperSN) {
		this.fOperSN = fOperSN;
	}

	public String getfOperID() {
		return fOperID;
	}

	public void setfOperID(String fOperID) {
		this.fOperID = fOperID;
	}

	public String getfNote() {
		return fNote;
	}

	public void setfNote(String fNote) {
		this.fNote = fNote;
	}

	public Double getfTargetQty() {
		return fTargetQty;
	}

	public void setfTargetQty(Double fTargetQty) {
		this.fTargetQty = fTargetQty;
	}

	public String getfStartTime() {
		return fStartTime;
	}

	public void setfStartTime(String fStartTime) {
		this.fStartTime = fStartTime;
	}

	public String getfEndTime() {
		return fEndTime;
	}

	public void setfEndTime(String fEndTime) {
		this.fEndTime = fEndTime;
	}

	public String getfDepName() {
		return fDepName;
	}

	public void setfDepName(String fDepName) {
		this.fDepName = fDepName;
	}

	public String getfDepid() {
		return fDepid;
	}

	public void setfDepid(String fDepid) {
		this.fDepid = fDepid;
	}

	public String getfIsOutStock() {
		return fIsOutStock;
	}

	public void setfIsOutStock(String fIsOutStock) {
		this.fIsOutStock = fIsOutStock;
	}

	public String getfMacId() {
		return fMacId;
	}

	public void setfMacId(String fMacId) {
		this.fMacId = fMacId;
	}

	public Double getfQtypass() {
		return fQtypass;
	}

	public void setfQtypass(Double fQtypass) {
		this.fQtypass = fQtypass;
	}

	public Double getFqtyfinish() {
		return fqtyfinish;
	}

	public void setFqtyfinish(Double fqtyfinish) {
		this.fqtyfinish = fqtyfinish;
	}

	public Double getFqtyForItem() {
		return fqtyForItem;
	}

	public void setFqtyForItem(Double fqtyForItem) {
		this.fqtyForItem = fqtyForItem;
	}

	public Double getFqtylost() {
		return fqtylost;
	}

	public void setFqtylost(Double fqtylost) {
		this.fqtylost = fqtylost;
	}

	public Double getfQtyscrap() {
		return fQtyscrap;
	}

	public void setfQtyscrap(Double fQtyscrap) {
		this.fQtyscrap = fQtyscrap;
	}

	public Double getfQtyback() {
		return fQtyback;
	}

	public void setfQtyback(Double fQtyback) {
		this.fQtyback = fQtyback;
	}

	@Override
	public String toString() {
		return "AutoRep [id=" + id + ", fIcmoId=" + fIcmoId + ", fBillNo=" + fBillNo + ", fNumber=" + fNumber
				+ ", fName=" + fName + ", fModel=" + fModel + ", fOperSN=" + fOperSN + ", fOperID=" + fOperID
				+ ", fNote=" + fNote + ", fTargetQty=" + fTargetQty + ", fStartTime=" + fStartTime + ", fEndTime="
				+ fEndTime + ", fDepName=" + fDepName + ", fDepid=" + fDepid + ", fIsOutStock=" + fIsOutStock
				+ ", fMacId=" + fMacId + ", fworker=" + fworker + ", fQtypass=" + fQtypass + ", fqtyfinish="
				+ fqtyfinish + ", fqtyForItem=" + fqtyForItem + ", fqtylost=" + fqtylost + ", fQtyscrap=" + fQtyscrap
				+ ", fQtyback=" + fQtyback + "]";
	}

	public DispatchedWorkers getdisp() {
		DispatchedWorkers dw = new DispatchedWorkers();
		dw.setfWorkcenterId(Integer.parseInt(this.fDepid));
		dw.setfIcmoId(this.getfIcmoId());
		dw.setfOperSN(this.getfOperSN());
		dw.setfMacId("00000034_00000428");
		dw.setfIsOutStock(false);
		dw.setfTargetQty(this.fTargetQty);
		return dw;
	}

	public StartWork getstar(Integer dispid, Integer uid, Date date) {
		StartWork st = new StartWork();
		st.setfBiller(uid);
		st.setfDate(date);
		st.setfDisPathId(dispid);
		st.setfMacId("00000034_00000428");
		st.setfWorker(this.fworker);
		st.setfOperSN(this.fOperSN);
		return st;
	}

	public EndWork getend(Integer stid) {
		EndWork en = new EndWork();
		en.setfStartWorkId(stid);
		en.setfWorker(this.fworker);
		en.setfQtyLost(this.fqtylost);
		en.setfForitemQty(this.fqtyForItem);
		en.setfPassQty(this.fQtypass);
		en.setfScrapQty(this.fQtyscrap);
		en.setfReworkQty(this.fQtyback);
		return en;
	}

	public Ipqc getipqc(Integer stid, Integer uid, Date date) {
		Ipqc ipqc = new Ipqc();
		ipqc.setfBiller(uid);
		ipqc.setfDate(date);
		ipqc.setfStartWorkId(stid);
		ipqc.setfWorker(this.fworker);
		ipqc.setfType(1);
		ipqc.setfStatus(0);
		return ipqc;
	}

	public Collection<IpqcEntry> getLie() {
		List<IpqcEntry> lie = new ArrayList<IpqcEntry>();
		IpqcEntry ie = new IpqcEntry();
		ie.setfName("外观");
		ie.setfQcQty(this.fQtypass);
		ie.setfOkQty(this.fQtypass);
		lie.add(ie);
		return lie;
	}
}